<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%>
<%@ page import="bean.library" %>
<%@ page import="dao.libraryDao" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'book.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<style type="text/css">
	   div{
	      float:left;
	      margin-left: 30px;
	      margin-right:30px;
	      margin-top: 5px;
	      margin-bottom: 5px;
	   }
	   div dd{
	      margin:0px;
	      font-size:10pt;
	   }
	   div dd.dd_borrow
	   {
	      color:blue;
	   }
	   div dd.dd_return
	   {
	      color:#000;
	   }
	</style>
  </head>
  
  <body>
    <h1>我借阅的书</h1>
    <hr>
    <center>
    	<table width="750" height="60" cellspacing="0" border="0">
    	<tr>
    	 <%
    	libraryDao libraryDAO  = new libraryDao();
    	List<library> libraryList = libraryDAO.selectAllLibrary();
    	if(libraryList != null && libraryList.size()>0)
    	{
    		for(int i=0; i<libraryList.size(); i++)
    		{
    		library	library = libraryList.get(i);
    	 %>
    	 <!-- 
    	  <div>
       	  <dl>
       	  	<dt>
       	  		<td><img src="image/<%=library.getPicture()%>" width="120" height="90" border="1"/></td>
       	  	</dt>
       	  	<dd class="dd_borrow"><%=library.getBookName() %></dd>
       	  	<dd class="dd_return">借阅时间：<%=library.getborrowTime()%>&nbsp;&nbsp;应还时间：<%=library.getReturnTime() %></dd>
       	  </dl>
       	 </div>
    	  --> 
    	 <td width="70%" valign="top">
             <table>
               <tr>
                 <td rowspan="1"><img src="image/<%=library.getPicture()%>" width="160" height="160"/></td>
               </tr>
               <tr>
                 <td><B><%=library.getBookName() %></B></td> 
               </tr>
               <tr>
                 <td>借阅时间：<%=library.getborrowTime()%></td>
               </tr>
               <tr>
                 <td>应还时间：<%=library.getReturnTime() %></td>
               </tr> 
             </table>
             <br>
          </td>
    	 <%
    	 	}
    	 }
    	  %>
    	  </tr>
    	</table>
    </center>
  </body>
</html>
